package com.xucy.springboot.designmodel.structural.composite.composite1;

/**
 * @Author xucy
 * @Date 2019-11-04 17:33
 * @Description
 **/

public class Course extends CourseComponent {
    String name;

    String price;

    Course(String name,String price){
        this.name=name;
        this.price=price;
    }

    @Override
    public void getPrice() {
        System.out.println(price);
    }

    @Override
    public String  getName() {
       return name;
    }

    @Override
    public void print() {
        System.out.println(name+" "+price);
    }
}
